subdiagnosis <- readr::read_tsv(
file.path("..", "..", "..", "data", "current", "SCPCP000006", "single_cell_metadata.tsv"),
show_col_types = FALSE
) |>
dplyr::filter(scpca_sample_id == params$sample_id) |>
dplyr::pull(subdiagnosis)This notebook explores using CopyKAT
to estimate tumor and normal cells in SCPCS000208 from SCPCP000006. This
sample has a(n) Anaplastic subdiagnosis.
CopyKAT was run using the 05_copyKAT.R
script using either an euclidean or statistical (spearman) method to
calculate distance in copyKAT. CopyKAT was run
with and without a normal reference. Immune and endothelial cells as
identified by label transfer were used as the references cells where
applicable.
These results are read into this notebook and used to:
# The base path for the OpenScPCA repository, found by its (hidden) .git directory
repository_base <- rprojroot::find_root(rprojroot::is_git_root)
# The current data directory, found within the repository base directory
data_dir <- file.path(repository_base, "data", "current", "SCPCP000006")
# The path to this module
module_base <- file.path(repository_base, "analyses", "cell-type-wilms-tumor-06")In this notebook, we are working with the Wilms tumor sample defined
in SCPCS000208 from the Wilms tumor dataset “SCPCP000006”. We work with
the pre-processed and labeled Seurat object that is the
output of
02b_label-transfer_fetal_kidney_reference_Stewart.Rmd saved
in the results directory.
result_dir <- file.path(module_base, "results", params$sample_id)
predictions_paths <- list()
full_ck_result_paths <- list()
for(ref_value in c("ref", "noref")){
for(distance_value in c("euclidean", "spearman")){
predictions_file <- glue::glue("05_copykat_", {params$sample_id}, "_",ref_value,"_distance-", distance_value, "_copykat_prediction.txt")
full_ck_result_file <- glue::glue("05_copykat_", {params$sample_id}, "_",ref_value,"_distance-", distance_value, "_copykat_CNA_results.txt")
predictions_paths[[glue::glue(ref_value, "_", distance_value)]] <- file.path(result_dir, "05_copyKAT", ref_value, distance_value, predictions_file)
full_ck_result_paths[[glue::glue(ref_value, "_", distance_value)]] <- file.path(result_dir, "05_copyKAT", ref_value, distance_value, full_ck_result_file)
}
}Reports will be saved in the notebook directory. The
pre-processed and annotated Seurat object per samples are
saved in the result folder.
Here we defined function that will be used multiple time all along the notebook.
Seurat objectBelow we look at the heatmaps produced by CopyKAT.